package cn.samler.diandi.api.annotation;

import cn.samler.diandi.api.validator.RoleValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 角色校验，目前仅支持传入EMPLOYER和SEEKER
 * @author samler
 */
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = RoleValidator.class)
public @interface IsRole {
    String message() default "role指定有误";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}
